package com.lhd.app.source;

import com.lhd.app.bean.UserBehavior;
import org.apache.flink.streaming.api.functions.source.RichSourceFunction;

public class UserBehaviorSource extends RichSourceFunction<UserBehavior> {
    private volatile boolean running = true;
    
    @Override
    public void run(SourceContext<UserBehavior> ctx) throws Exception {
        while (running) {
            // 从Kafka或其他数据源读取数据
            // UserBehavior behavior = readFromKafka();
            // ctx.collect(behavior);
            Thread.sleep(100);
        }
    }
    
    @Override
    public void cancel() {
        running = false;
    }
}